﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using Top.Api.Response;

namespace TB_WinForm
{
    public partial class Form1: Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void toolStripButton4_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            toolStripLabel1.Text = "服务器："+SysInfo.Get_Server();

            toolStripButton5.Visible = false;

            if(SysInfo.Get_Server()=="LY")
            {
                SysInfo.WSHBL.Url = "http://ly.59igou.com/ASMX/HongBao_Logic.asmx";
                SysInfo.WSSELLER.Url = "http://ly.59igou.com/ASMX/Seller_Manage.asmx";
                SysInfo.WSTOP.Url = "http://ly.59igou.com/ASMX/TB_TOP.asmx";
            }


            Form.CheckForIllegalCrossThreadCalls = false;
            Thread Update_Seller_Info = new Thread(new ThreadStart(UP_SE_INFO));
            Update_Seller_Info.Start();
        }
        private void UP_SE_INFO()
        {
            SysInfo.Seller_Info = SysInfo.WSSELLER.GET_SELLER_INFO(SysInfo.Seller_Nick.ToString());
            toolStripButton2.Enabled = true;
            toolStripButton6.Enabled = true;
        }

        private void toolStripButton2_Click(object sender, EventArgs e)
        {
            HongBao.Express_HongBao HHEH = new HongBao.Express_HongBao();
            HHEH.MdiParent = this;
            HHEH.Show();
        }

        private void toolStripButton5_Click(object sender, EventArgs e)
        {
            //isv.feedId-error 找不到评价内容
            LeShiTao_Library.TB_Top.TB_Util tbutil = new LeShiTao_Library.TB_Top.TB_Util(
                SysInfo.Seller_Info.Tables[0].Rows[0][5].ToString(),
                SysInfo.Seller_Info.Tables[0].Rows[0][6].ToString(),
                SysInfo.Seller_Info.Tables[0].Rows[0][7].ToString());
            TraderateImprImprwordByfeedidGetResponse Rate = tbutil.GET_RATE_DIS("1663810884125674");
            TradeFullinfoGetResponse Trade_Info = tbutil.GET_Trade_Fullinfo("1663810884125674");

            MessageBox.Show(Rate.ImprFeed.Rate.ToString());

        }

        private void toolStripButton3_Click(object sender, EventArgs e)
        {
            Settings.Settings SS = new Settings.Settings();
            SS.MdiParent = this;
            SS.Show();
        }

        private void toolStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {

        }

        private void toolStripButton6_Click(object sender, EventArgs e)
        {
            HongBao.HB_Batch HBHB = new HongBao.HB_Batch();
            HBHB.MdiParent = this;
            HBHB.Show();
        }

        private void toolStripButton7_Click(object sender, EventArgs e)
        {
            Apple_Box.YDB ABY = new Apple_Box.YDB();
            ABY.MdiParent = this;
            ABY.Show();
        }
    }
}
